package com.jeff.android.lab.algorithm;

import com.jeff.android.lab.BaseRecyclerViewFragment;
import com.jeff.android.lab.util.RouterUtil;

import java.util.ArrayList;
import java.util.List;

public class AlgorithmMainFragment extends BaseRecyclerViewFragment {

    @Override
    protected List<String> getData() {
        return new ArrayList<String>() {
            {
                add("QuickSort");
                add("BubbleSort");
                add("Fibonacci");
            }
        };
    }

    @Override
    protected void launch(String widget) {
        if ("QuickSort".equals(widget)) {
            RouterUtil.launchFragmentActivity(getContext(), QuickSortFragment.class);
        } else if ("BubbleSort".equals(widget)) {
            RouterUtil.launchFragmentActivity(getContext(), BubbleSortFragment.class);
        } else if ("Fibonacci".equals(widget)) {
            RouterUtil.launchFragmentActivity(getContext(), FibonacciFragment.class);
        }
    }

}
